import React from 'react';
import { connect } from 'dva';
import { Picker,Drawer, List, NavBar,Icon, InputItem , TabBar,Pagination ,Toast ,Button,TextareaItem,WhiteSpace,Popover} from 'antd-mobile';
import Reset from '../style/ResetInput.less'
import { Link } from 'dva/router';
import style from '../style/App.less'
import PropTypes from 'prop-types';
const Item = Popover.Item;
class Right extends React.Component{
	constructor(props){
		super(props);
		this.state={
			list:this.bianji,
			visible:false,
		}
	}
	componentWillMount(){
		// let menu_edit=window.sessionStorage['menu_edit']==undefined?[]:JSON.parse(window.sessionStorage['menu_edit']);
		// this.setState({list:menu_edit})
		console.log(this.props.location.pathname)
		// this.setState({url:this.props.location.pathname})
	}
	componentWillReceiveProps(nextProps){
    // console.log(!nextProps.routes[1].path.match(/info/g))
    // if(!!nextProps.routes[1].path.match(/info/g)){
    	
    // }else if(!!nextProps.routes[1].path.match(/edit/g)){

    // }else if(!!nextProps.routes[1].path.match(/new/g)){

    // }else{
    //   this.setState({edit:'create'})
    // }
    this.setState({url:window.sessionStorage['new']})

  }
	render(){
		return(
			<Link style={{color:'#fff'}} to={{pathname:this.state.url}}>新建</Link>
		)
	}
}
export default connect()(Right)